import os


# host 主机
HOST = "127.0.0.1"
# redis 主机
REDIS_HOST = "127.0.0.1"  # 安装在centos时需要 /etc/redis/6379.conf: bind 192.168.10.1
REDIS_PORT = "6379"
TITLE = 'FAST API 接口服务'
DESCRIPTION = '面向APP 提供数据API接口服务'
# mysql连接参数
MYSQL = {
    'DB': 't',
    'USR': 'root',
    'PWD': '123456',
    'HOST': '127.0.0.1',
    'PORT': '3306',
    'CHARSET': 'charset=utf8',
    'DB_MODULE': 'mysqlconnector'
    # 'DB_MODULE': 'pymysql'     # 此模块在py3 报1366 更换为 mysql-connector
}
MYSQL_URI = "mysql+%s://%s:%s@%s:%s/%s?%s" \
    % (MYSQL['DB_MODULE'], MYSQL['USR'], MYSQL['PWD'], MYSQL['HOST'], MYSQL['PORT'], MYSQL['DB'], MYSQL['CHARSET'])
SQLALCHEMY_DATABASE_URI = "mysql+%s://%s:%s@%s:%s/%s?%s" \
    % (MYSQL['DB_MODULE'], MYSQL['USR'], MYSQL['PWD'], MYSQL['HOST'], MYSQL['PORT'], MYSQL['DB'], MYSQL['CHARSET'])

SECRET_KEY = '9b4f9e04d5fe461a957bac1d47c694a0'  # uuid.uuid4().hex


UPLOAD_DIR = "app/static/uploads/"                  # 上传文件目录
_UPLOAD_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)),UPLOAD_DIR)
BASE_DIR = os.path.dirname(os.path.abspath(__file__))

# 后台init 初始化 基础数据  角色 管理员 基本标签
ROLE_USER = {"name":"普通用户", "auth":1}
ROLE_VIPUSER = {"name":"VIP用户", "auth":5}
ROLE_ADMIN = {"name":"管理员", "auth":6}
ROLE_SUPER = {"name":"超管", "auth":9}


SUPPER_USER = {'name': 'su', 'password': '123456', 'email':'su@163.com', 'role_id':1}

TAG_LI = ["喜剧","悲剧","恐怖","日剧","韩剧","美剧","港剧","泰剧","B站","动画"]
